Object.defineProperty(exports, "__esModule", {
    value: !0
}), exports.default = void 0;

var _api = _interopRequireDefault(require("../../../utils/api")), _storage = _interopRequireDefault(require("../../../utils/storage"));

function _interopRequireDefault(e) {
    return e && e.__esModule ? e : {
        default: e
    };
}

var _default = {
    data: {
        officialShown: !1
    },
    onLoad: function() {
        this.official = _storage.default.getSync("official");
    },
    onShow: function() {
        this.official || this.checkIsSubscribe();
    },
    checkIsSubscribe: function() {
        var t = this;
        this.subscribe || _api.default.minicard.user.checkissubscribe().then(function(e) {
            if (!e || !e.data) return Promise.reject();
            var i = e.data.subscribe;
            t.subscribe = i, t.setData({
                officialShown: !i
            });
        }).catch(function() {
            t.setData({
                officialShown: !0
            });
        });
    },
    onOfficialClose: function() {
        _storage.default.set("official", 1), this.official = !0;
    },
    onAuthCancel: function() {
        this.$route("/pages/view/view?type=official");
    }
};

exports.default = _default;